Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an install command #30

Merged
merged 1 commit into from
Jan 24, 2023
Merged

Add an install command #30

merged 1 commit into from
Jan 24, 2023

Conversation

cgwalters
Copy link
Collaborator

@cgwalters cgwalters commented Dec 21, 2022

Usage example with /dev/vda being an extra mounted disk:

$ podman run --privileged --pid=host --net=none --security-opt label=type:unconfined_t quay.io/cgwalters/c9s-oscore:latest bootc install /dev/vda

Code and high level design

This merges a lot of code and logic from coreos-installer, coreos-assembler and some bits of fedora-coreos-config.

Unlike ostree, bootc install understands and manipulates block devices and bootloaders.

  • coreos-installer: ignition and blockdev.rs code
  • coreos-assember: sgdisk invocations and ostree repo setup translated to Rust
  • fedora-coreos-config: Things like transposefs, boot/root uuid handling are now done on the "install boot" here

Note this obviates much of the need for generating disk images. That said, it may also make sense to have bootc install generate-iso.

TODO items:

  • Add support for e.g. --copy-network type flows as well as remote config via configmap and secrets #22
  • Implement ppc64le and s390x (needs code from both coreos-assembler and coreos-installer)
  • support installing from SELinux-disabled hosts (needs Add support for forcing on selinux labels ostreedev/ostree#2804 )
  • Support overwriting disk we used to boot (systemctl switch-root to container image?)
  • Support basic partition configs (e.g. /var)
  • Related, investigate https://www.freedesktop.org/software/systemd/man/systemd-repart.html
  • Also support running Ignition from the "install boot"; this would make debugging Ignition configs dramatically nicer
  • Ensure we lock devices when partitioning https://systemd.io/BLOCK_DEVICE_LOCKING/
  • Support config files (e.g. distro default filesystem specified in /usr/lib/bootc/install.cfg)
  • Support (or default) to only installing EFI if booted that way, etc.
  • Support systemd-boot
  • Clean up/refactor install code to be more distribution-independent in general
  • Consider merging bootupd in here as e.g. bootc bootloader update or so?
  • Documentation
  • Tests
  • More explicitly test host/target kernel compatibility (e.g. filesystems)

Closes: #24
Closes: #1

@openshift-ci
Copy link

openshift-ci bot commented Dec 21, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link

openshift-ci bot commented Dec 21, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cgwalters

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cgwalters cgwalters force-pushed the install branch 7 times, most recently from 1ea8c45 to 487d419 Compare December 27, 2022 20:25
@cgwalters cgwalters force-pushed the install branch 5 times, most recently from cc65cde to 4eb5fb7 Compare January 2, 2023 15:49
cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Jan 2, 2023
In this case, we shouldn't have anything to do.  This is needed
for `bootc install` which currently sets up these kargs in advance.
containers/bootc#30
cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Jan 10, 2023
In this case, we shouldn't have anything to do.  This is needed
for `bootc install` which currently sets up these kargs in advance.
containers/bootc#30
@cgwalters cgwalters force-pushed the install branch 5 times, most recently from 36b3ac5 to afa55bf Compare January 12, 2023 21:26
@cgwalters
Copy link
Collaborator Author

mount: /sys/fs/selinux: mount point does not exist.

OK yeah. Let's see if we can support the exciting case of also installing from systems with SELinux disabled...

@cgwalters cgwalters force-pushed the install branch 2 times, most recently from b4ecb69 to a0f9a4e Compare January 13, 2023 14:16
@cgwalters
Copy link
Collaborator Author

OK yeah, this path of testing bootc install from the ubuntu system needs ostreedev/ostree#2804

So, going to instead look at doing CI on Fedora for that.

@cgwalters cgwalters force-pushed the install branch 3 times, most recently from cd5a329 to 58eaeed Compare January 16, 2023 15:43
cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Jan 17, 2023
In this case, we shouldn't have anything to do.  This is needed
for `bootc install` which currently sets up these kargs in advance.
containers/bootc#30
@cgwalters cgwalters force-pushed the install branch 2 times, most recently from 2bedb76 to 43f9716 Compare January 22, 2023 18:49
@cgwalters
Copy link
Collaborator Author

/test all

Usage example with `/dev/vda` being an extra mounted disk:

```
$ podman run --privileged --pid=host --net=none quay.io/cgwalters/c9s-oscore:latest bootc install /dev/vda
```

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters marked this pull request as ready for review January 22, 2023 19:31
@cgwalters
Copy link
Collaborator Author

OK, we now have a CI test that proves this works. I think it's about time to get this merged and do further followups (there'll be a lot) as distinct PRs on top of a proven working base. Lifting draft!

@cgwalters cgwalters changed the title WIP: Add an install command Add an install command Jan 22, 2023
@cgwalters
Copy link
Collaborator Author

OK no real team on this repo for now so no peer review...

@cgwalters cgwalters merged commit 0851130 into containers:main Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

run as install_t Add install verb
1 participant